package com.wenx.v3system.modular.cloud.domain.maps;

import com.wenx.v3system.modular.cloud.domain.dto.UserLoginDto;
import com.wenx.v3system.modular.cloud.domain.dto.UserRegisterDto;
import com.wenx.v3system.modular.cloud.domain.po.SysUser;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 用户认证相关映射接口
 */
@Mapper(componentModel = "spring")
public interface UserAuthMap {

    UserAuthMap INSTANCE = Mappers.getMapper(UserAuthMap.class);

    /**
     * 用户注册DTO转换为用户实体
     */
    @Mapping(source = "username", target = "realName")
    SysUser registerToPo(UserRegisterDto dto);

    /**
     * 用户登录DTO转换为用户实体（用于查询）
     */
    SysUser loginToPo(UserLoginDto dto);
} 